package cn.zsb.zsb.ctrl;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author oldliu
 * @since 1.0
 */
@RestController
@RequestMapping("user")
public class UserController {

    @PostMapping("login")//参数u,p自动绑定请求中的值
    public String login(@RequestParam(name = "uname")String u, @RequestParam(name = "upass")String p){
        //request.getParameter("u")
        if(u.startsWith("java82")&&p.equals("12345"))
            return "登录成功";
        return "登录失败";
    }
}
